package com.gbb.simple;

import android.app.IntentService;
import android.content.Intent;
import androidx.annotation.Nullable;

import com.gbb.common.log.LogUtils;

/**
 * 测试IntentService的生命周期
 *
 * @author gaobingbing on 2018-01-25.
 */
public class AsyncService extends IntentService {

    private static final String TAG = "AsyncService";

    public AsyncService() {
        super("Thread0");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        LogUtils.e(TAG,"onCreate:" + Thread.currentThread());
    }

    @Override
    public void onStart(@Nullable Intent intent,int startId) {
        super.onStart(intent,startId);
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        LogUtils.e(TAG,Thread.currentThread() + "\n" + intent.toString());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        LogUtils.e(TAG,Thread.currentThread() + ":onDestroy");
    }

}
